package com.ice.work.moment.facade.ticket.enums;

/**
 * @Description 车票类型
 * @Author DELL
 * @Create 2019-05-27
 * @Since 1.0.0
 */
public enum TicketCategoryEnum {
    //  adult: "1",
    //        child: "2",
    //        student: "3",
    //        disability: "4"
    ADULT(1, "ADULT", "成人票"),
    STUDENT(3, "0X00", "学生票"),
    CHILD(2, "0X00", "孩票"),
    DISABILITY(4, "0X00", "伤残军人票");
    public Integer type;
    public String code;
    public String remark;

    TicketCategoryEnum(Integer type, String code, String remark) {
        this.type = type;
        this.code = code;
        this.remark = remark;
    }
    public static String getCode(Integer code) {
        for (TicketCategoryEnum ticketCategoryEnum : TicketCategoryEnum.values()) {
            if (ticketCategoryEnum.type.equals(code)) {
                return ticketCategoryEnum.code;
            }
        }
        return ADULT.code;
    }
}
